Convert all occurences of pointer arithmetic using integral types to use
the standard ptrdiff_t and intptr_t types. Fixes some build warnings.
#include "config.h"
#include "babl-internal.h"
+#include <stddef.h>
#include <string.h>
#include <stdarg.h>
/* value of 'id' will be used as argument for hash function,
* substraction serves as simple combination of
* source/destination values. */
- int id = (int) source - (int) destination;
+ ptrdiff_t id = source - destination;
/* instances with id 0 won't be inserted into database */
if (id == 0)
id = 1;
*/
#include "config.h"
+#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
if (!ret)
babl_fatal ("args=(%i): failed", size);
- offset = BABL_ALIGN - ((unsigned int) ret + BABL_ALLOC) % BABL_ALIGN;
+ offset = BABL_ALIGN - ((uintptr_t) ret + BABL_ALLOC) % BABL_ALIGN;
ret = ret + BABL_ALLOC + offset;
*((void **) ret - 1) = ret - BABL_ALLOC - offset;
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(USE_SSE) && defined(USE_MMX)
+#include <stdint.h>
#include <stdlib.h>
#include "babl.h"
{
long n = samples;
- if ((int) src & 0xF)
+ if ((intptr_t) src & 0xF)
{
// nonaligned buffers, we have to use fallback x87 code
float *fsrc = (float *) src;
long samples)
{
long n = samples;
- if ((int) src & 0xF)
+ if ((intptr_t) src & 0xF)
{
// nonaligned buffers, we have to use fallback x87 code
float *fsrc = (float *) src;